A square wave generator circuit is a signal generator circuit extensively used in integrated circuits. FIG. 1 illustrates a schematic diagram of a square wave generator circuit in the prior art. As shown in FIG. 1, a square wave generator circuit 10 comprises a constant current source 101 and a capacitor 102 connected in series between an operating voltage VDD and ground. A switch 103 is connected in parallel between both terminals of the capacitor 102. The switch 103 periodically opens or closes under control of a clock signal clk with a very narrow pulse width (e.g., with a 1% duty cycle), so that a sawtooth wave signal vramp is generated at a non-grounded terminal of the capacitor 102. The square wave generator circuit 10 further comprises a comparator 104. An in-phase input terminal of the comparator 104 receives a reference voltage signal vref, and an anti-phase input terminal of the comparator 104 is connected to the non-grounded terminal of the comparator 102 so that a square wave signal is outputted at an output terminal of the comparator 104.
Assuming that a duration of a high level of the generated square wave signal be t1 and a clock cycle of the clock signal clk be T, a voltage Vrap of the generated sawtooth wave signal vramp may be expressed as: Vrap=(t*I)/C, where t is a charging time of the capacitor, I is a charging current of the capacitor, and C is a capacitance of the capacitor. At a turning point of the comparator 104, there exists Vrap=Vref, wherein Vref is a voltage of a reference voltage signal vref. Therefore, it can be obtained that t1=C*Vref/I. Hence, the duty cycle of the generated square wave signal duty=C*Vref/I*T. In view of the above, the duty cycle of the square wave signal is associated with all of the capacitor C of the capacitor, the voltage Vref of the reference voltage signal vref, the charging current I and the clock cycle T of the clock signal clk. Therefore, once one of the above parameters changes, the duty cycle of the square wave signal will change, thereby causing a deviation of the duty cycle of the square wave signal in different clock cycles. That it to say, the duty cycle of the square wave signal has a lower precision.
However, the square wave signal with a high-precision duty cycle usually needs to be used in many applications. For example, in a DC/DC or AC/DC circuit, a square wave signal with a high-precision duty cycle needs to be used for precisely controlling a waveform of a PWM signal generated by a PWM signal generator. Hence, the square wave generator circuit in the prior art cannot meet requirements in practical applications.